import { createApp } from "vue";
let app = createApp(App);
import "Normalize.css";
import App from "./App.vue";
import "@/route/permission";

//通用css引入iconfont图标
import "@/assets/iconfont/iconfont.css";

//引入通用样式表
import "@/assets/css/common.css";

//引入element-plus的样式表
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";

//引入字体图标
import "@/assets/icon/iconfont.js";

//element-plus 使用中文
import zhCn from "element-plus/es/locale/lang/zh-cn";
app.use(ElementPlus, { locale: zhCn });

//svg全局组件
import SvgIcon from "@/components/svg/index.vue";
app.component("SvgIcon", SvgIcon);

//全局注册面包屑组件
import BreadCrumb from "@/components/breadcrumb/index.vue";
app.component("BreadCrumb", BreadCrumb);

//router配置
import router from "@/route/index";

//elementplus中icon图标的引入
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

//pinia的使用
import { createPinia } from "pinia";
import piniaPluginPersist from "pinia-plugin-persist"; //pinia持久化
const pinia = createPinia();
pinia.use(piniaPluginPersist);
app.use(pinia);

//引入自定义的i18n
import i18n from "@/i18n/index";

//引入自定义UI组件
import CustomUI from "./libs/zw-ui";

app.use(router).use(CustomUI).use(i18n).mount("#app");
